package com.cloudkinto.service.consumer.vo.rakuten;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class BasketidModelRequest implements Serializable {
    private Long basketId;
    private List<ShippingModelEntity> ShippingModelList;

    @JSONField(name = "ShippingModelList")
    public List<ShippingModelEntity> getShippingModelList() {
        return ShippingModelList;
    }

    public void setShippingModelList(List<ShippingModelEntity> shippingModelList) {
        //默认最多传20个
        if (shippingModelList.size()>20) {
            ShippingModelList = shippingModelList.subList(0, 20);
        }else {
            ShippingModelList = shippingModelList;
        }
    }
}
